Skip to content

Conversation

@Frando
Copy link
Member

@Frando Frando commented Dec 2, 2025

Description

Updates iroh-quinn to n0-computer/quinn#208 which has qlog updated to n0-qlog and changes to the latest qlog drafts and adds support for mulitpath in qlog.

Also added qlog support for a test that has multiple paths. Create the files with:
IROH_TEST_QLOG=1 cargo test -p iroh --lib --features qlog -- endpoint_two_relay_only_becomes_direct

Breaking Changes

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.
    • List all breaking changes in the above "Breaking Changes" section.
    • Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are:

ramfox and others added 3 commits December 2, 2025 15:45
## Description

Whenever we insert a new path, trigger pruning paths.

We currently only prune IP paths, and pruning paths only occurs if we
have more than 30 IP paths.

We will prune any paths that did not successfully holepunch. 

If there are still over 30 IP paths left, then we order the "inactive"
paths (paths that have been closed, but at one point holepunched), and
prune the paths that were closed earliest.

## Notes and Questions

- Added constants:
    - `MAX_IP_PATHS` = 30 - maximum IP paths per endpoint
    - `MAX_INACTIVE_IP_PATHS` = 10 - maximum inactive IP paths to keep
- New `PathState` field:
    - `status` - tracks the `PathStatus` of the path
- New `PathStatus` enum:
    -  `PathStatus::Open` - is an open path
    - `PathStatus::Inactive(Instant)` - was opened once, but currently inactive
    - `PathStatus::Unusable` - we attempted to use it, but it never connected
    - `PathStatus::Unknown` - we don't know the status yet
- New methods on `RemotePathState`:
  - `abandoned_path` - marks a path as abandoned with timestamp, triggered when we get the `PathEvent::Abandoned` event
  - `prune_paths` - triggers path pruning, occurs whenever we insert a path to the `RemotePathState`
  - changed `insert` to `insert_open_path`
- New `prune_ip_paths` function with all the prune logic:
    - Only prunes if IP paths exceed `MAX_IP_PATHS`
    - Never prunes active paths or paths of unknown status
    - Always prunes failed holepunch attempts (PathStatus::Unusable)
    - Keeps 10 most recently inactive paths that were previously successful
- Special case: if all paths failed, keeps `MAX_IP_PATHS` instead of pruning everything
- Added tests for edge cases and the typical case
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3725/docs/iroh/

Last updated: 2025-12-04T11:32:26Z

@n0bot n0bot bot added this to iroh Dec 3, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Dec 3, 2025
dignifiedquire and others added 8 commits December 3, 2025 10:32
…ain minimums when used with multipath (#3721)

## Description

This PR encapsulates the `quinn::TransportConfig` in a new struct called
`QuicTransportConfig`. It has all of the same methods as the
`quinn::TransportConfig`, but the follow methods will log warnings if
the user given values make iroh + multipath sub-optimal:
- default_path_keep_alive_interval() - should be at most
`HEARTBEAT_INTERVAL`ms
- default_path_max_idle_timeout() - should be at most
`PATH_MAX_IDLE_TIMEOUT`ms
- max_concurrent_multipath_paths() - should be at least `MAX_MULTIPATH +
1`
- set_max_remote_nat_traversal_addresses() - should be at least
`MAX_MULTIPATH`

These values are also set properly by default when creating a
`QuicTransportConfig`.

## quinn encapsulation/co-location

Created a new mod `quic` and co-located all the quinn exports there.

This would be the mod where we do any future encapsulation.

Note: the `StaticConfig` struct is a private struct that still uses
`quinn::TransportConfig` directly.

closes #3635 

## Breaking Changes
- `iroh`
    - changes
- `QuinnTransportConfig` renamed to `QuicTransportConfig` & is now
`Clone`
- `ConnectOptions::transport_config:
Option<Arc<quinn::TransportConfig>>` ->
`ConnectOptions::transport_config: Option<QuicTransportConfig>
- `ConnectOptions::with_transport_config(mut self, transport_config:
Arc<quinn::TransportConfig>)` ->
`ConnectOptions::with_transport_config(mut self, transport_config:
QuicTransportConfig)

## Open Questions
- [x] Need verification that my assumptions about "at least" and "at
most" for the above are the correct assumptions about what we want.
**done in #3635**
@Frando Frando force-pushed the Frando/qlog-latest branch from d6dd318 to ff276d5 Compare December 5, 2025 10:27
@Frando Frando closed this Dec 5, 2025
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in iroh Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants